package com.cdtye.shuoh.service.product;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cdtye.common.webcore.web.AjaxJson;
import com.cdtye.shuoh.domain.product.entity.Product;
import com.cdtye.shuoh.domain.product.vo.ProductVo;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * 产品Service
 * @author ZhongWang Wang
 * @date 2022-12-21
 */
@Service
public interface ProductService extends IService<Product> {

    /**
     * 产品模型导入
     * @param file
     * @return
     */
    AjaxJson importProductJsonFile(MultipartFile file) throws Exception;

    /**
     * 解析产品模型数据
     * @param content
     * @return
     */
    AjaxJson productJsonDataAnalysis(JSONObject content);


    /**
     * 根据产品模型创建超级表
     *
     * @param product
     * @param services
     * @return
     * @throws Exception
     */
    AjaxJson createSuperTable(Product product, JSONArray services) throws Exception;


    Product findOneByProductIdentificationAndProtocolType(String productIdentification, String protocolType);

    Product findOneByModel(String model);

    Product getByProductIdentification(String productIdentification);

    IPage<Product> pageList(ProductVo vo);

    /**
     * 获取详情
     * @param id
     * @return
     */
    Product getById(String id);

    /**
     * 修改产品信息
     * @param vo
     * @return
     */
    int updateProduct(ProductVo vo);

    List<Product> selectList(ProductVo vo);

    int deleteById(String id);

    Map<String,Object> stateStatistic();

}
